<!DOCTYPE html>
<html lang='en'>

<head>
  <meta charset='UTF-8'>
  <meta name='viewport' content='width=device-width, initial-scale=1.0'>
  <title></title>
  <script type='text/javascript' src='js/vue.js'></script>
</head>

<body>
  <div id='app'>
    <son @tofa="app($event)"></son>
  </div>
  <script type='text/javascript'>
    var son = {
      data(){
        return {
          msg: '这是子元素的内容'
        }
      },
      methods: {
        fff(){
          this.$emit('tofa', this.msg);
        }
      },
      template: `<div @click="fff">{{msg}}</div>`
    }
    var vm = new Vue({
      el: '#app',
      data: {

      },
      methods: {
        app(val){
          console.log(val);
        }
      },
      components: {
        son
      }
    });
  </script>
</body>

</html>